<template>
    <div id="app">
          <div class="app" v-for="hot in Hot" :key="hot.index"  @click="jump(hot.id)">
             

                  
            
            <div class="divimg">
                <img :src="hot.img"   alt="" >
            </div>
            <div class="divtext" >
                <div class="topdiv">
                    <p class="topp">
                        <!-- <span class="span1">【{{hot.city}}】</span> -->
                        <!-- addres -->
                        <span class="span2">{{hot.name}}</span>
                    </p>

                    <span class="centspan">{{hot.date}}</span>
                    <br>
                    <span class="centspan"> {{hot.address}}</span>
                    <!-- <span class="centspan"> {{hot.address}} </span> -->
                    <br>
                    <!-- <span class="discount" v-if="hot.seat"   >无座</span> -->
                    <!-- <span class="seat" v-if="hot.discount">{{hot.discount}}</span> -->
                </div>
                <div class="bottdiv">
                        <p class="leftp"> <span>{{hot.price}}</span> 起</p> 
                        <p class="rightp"  >
                          <span class="rightspan">
                              {{hot.score}}
                          </span>
                           <!-- <van-rate v-model="hot.score" readonly count=8 size=10 /> -->
                           </p>

                </div>
            </div>
        </div>
          <!-- <div class="app"  >
            <div class="divimg">
                <img src="../../public/img/1.jpg" alt="" >
            </div>
            <div class="divtext" >
                <div class="topdiv">
                    <p class="topp">
                        <span class="span1">【西安】</span>
                        <span class="span2">西安真有社</span>
                    </p>

                    <span>2021.02.29-25:22</span>
                    <br>
                    <span>西安 | </span>
                    <span> 真有社剧场</span>
                    <br>
                    <span class="discount"></span>
                    <span class="seat"></span>
                </div>
                <div class="bottdiv">
                        <p class="leftp"> <span>¥40</span> 起</p> 
                        <p class="rightp">
                            
                            <van-rate v-model="value" allow-half void-icon="star" void-color="#eee" count=5  size="10"  />
                            
          
                            9.2分</p>

                </div>
            </div>
        </div> -->




           
        <!-- <div class="list"   v-for="app in APP" :key="app.id">
            <div class="listimg">
                <img src="../../public/img/3.jpg" alt="" >
            </div>
            <div class="listtext">
               <p class="topp">西安LIVE</p>
               <p class="centerp">人气榜</p>
               <div class="bottp">
                    <p class="leftp">4789 <span>人想看</span></p>
                    <p class="rightp">去看看</p>
               </div>
            </div>
        </div> -->


         <div class="list"  v-for="(app,index) in APP" :key="index"  >
            <div class="listimg">
                <img :src="app.img" alt="" >
            </div>
            <div class="listtext">
               <p class="topp">{{app.theme}}</p>
               <p>{{app.listtype}}</p>
               <div class="bottp">
                    <p class="leftp"> <span>{{app.people}}</span>人想看</p>
                    <p class="rightp">去看看</p>
               </div>
            </div>
        </div>

       


       



        
            
            
       
        
    </div>
</template>

<script>
import Vue from "vue";
import { Rate } from "vant";

Vue.use(Rate);

import axios from "axios";
export default {
  // props(){

  // },
  neme: "sect",
  data() {
    return {
      Hot: [],
      value: 6,

      APP: []
    };
  },

  created() {
    //  发送请求获取分类列表

    //   let http = new XMLHttpRequest();
    //     http.open("get", " http://localhost:3000/hot");
    //     http.send();
    //     http.onreadystatechange = () => {
    //       if (http.readyState === 4) {
    //         this.List = JSON.parse(http.responseText);
    //         console.log( this.List)
    //       }
    //     };

            axios({
              url: "/hot",
              params: {
                // type: "hot"
              }
            }).then(res => (this.Hot = res.data));
            // console.log("this.Hot", this.Hot);
            //下面
            axios({
              url: "/List",
              params: {
                // type: "hot"
              }
            }).then(res => (this.APP = res.data));
            // console.log("this.APP.city", this.APP.city[0]);
          },
      methods:{

            jump(ID){

         this.$router.push({ path: '/Detail', query: { num:ID }})

            }
          }

};
</script>

<style scoped>
#app {
  height: auto;
  margin: 0rem 0.1rem;
  width: 100%;
}
.app .divimg {
  width: 30%;
  height: 100%;
  float: left;
  margin-right: 0.1rem;
}
.app .divimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app {
  width: 95%;
  background-color: #eee;

  height: 1.5rem;
  width: 100%;
  margin-bottom: 0.4rem;
}
.divtext {
  height: 100%;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  padding-right: 0.2rem;
}
.topdiv {
  height: 100%;
  /* background-color: hotpink; */
}
.topdiv .topp {
  max-height: 0.6rem;
  /* 文字超出两行显示省略号 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.topdiv .centspan {
  font-size: 0.15rem;
  line-height: 0.3rem;
  height: 0.3rem;
}

.topdiv .topp span {
  height: 0.3rem;
  line-height: 0.3rem;
  font-size: 0.18rem;
  font-weight: bold;
}
.topdiv .discount {
  display: inline-block;
  border: 1px solid black;
  border-radius: 0.1rem;
  margin: 0.05rem 0.02rem;
  padding: 0rem 0.05rem;
  height: 0.15rem;
  line-height: 0.15rem;
}
.topdiv .seat {
  display: inline-block;
  border: 1px solid black;
  border-radius: 0.1rem;
  margin: 0.05rem 0.02rem;
  padding: 0rem 0.05rem;
  height: 0.15rem;
  line-height: 0.15rem;
}
.bottdiv {
  display: flex;
  justify-content: space-between;
}
.bottdiv .rightspan {
  font-size: 0.15rem;
}
.bottdiv .leftp span {
  font-size: 0.18rem;
  color: hotpink;
}

.list {
  width: 85%;
  height: 1rem;
  background: seashell;
  border: 1px solid #ccc;
  border-radius: 0.2rem;
  padding: 0.1rem;
  /* margin: 0rem 2%; */
  float: left;
  margin-bottom: 0.4rem;
}
.list .listimg {
  margin-left: 2%;
  margin-right: 3%;
  width: 25%;
  height: 100%;
  float: left;
  background: green;
  box-shadow: black 0 0 10px;
}
.listimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* border: 1px solid black;
  border-radius: 0.1rem; */
}
.list .listtext {
  display: flex;
  justify-content: space-around;
  flex-direction: column;
  float: left;
  height: 100%;
  margin-left: 5%;
  width: 60%;
}
/* .list .listtext  p{
font-size: 0.2rem;

} */

.listtext .topp {
  font-size: 0.2rem;
  font-weight: bold;
}
.listtext .centerp {
  font-size: 0.15rem;
}

.bottp {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.list .leftp {
  color: orange;
  font-size: 0.15rem;
}
.list .rightp {
  width: auto;
  padding: 0.05rem 0.1rem;
  background-color: blueviolet;
  border-radius: 0.2rem;
  font-size: 0.15rem;
}
</style>
